package com.hanhanxiaochong.zhongxiangchuanmei.view.my.adapter;

import android.content.Context;

import com.hanhanxiaochong.zhongxiangchuanmei.R;
import com.hanhanxiaochong.zhongxiangchuanmei.bean.LSMXBean;
import com.hanhanxiaochong.zhongxiangchuanmei.config.CommonAdapter;
import com.hanhanxiaochong.zhongxiangchuanmei.config.ViewHolder;
import com.hanhanxiaochong.zhongxiangchuanmei.util.StringUtils;

import java.util.List;

/**
 * Author : 贾桐
 * E-mail : 653773284@qq.com
 * Time   : 2018/6/6.
 * Desc   :
 */

public class MyWalletLSMXAdapter extends CommonAdapter<LSMXBean> {

    public MyWalletLSMXAdapter(Context context, int layoutId, List<LSMXBean> datas) {
        super(context, layoutId, datas);
    }

    @Override
    protected void convert(ViewHolder holder, LSMXBean lsmxBean, int position) {
        //金额
        if (StringUtils.isEmpty(lsmxBean.getMoney())){
            holder.setText(R.id.txt_money, lsmxBean.getMoney());
        }
        //时间
        if (StringUtils.isEmpty(lsmxBean.getAdd_time())){
            holder.setText(R.id.txt_time, lsmxBean.getAdd_time());
        }
        //类型
        if (StringUtils.isEmpty(lsmxBean.getType())){
            if (lsmxBean.getType().equals("1")){
                holder.setText(R.id.txt_type, "充值");
            }else if (lsmxBean.getType().equals("2")){
                holder.setText(R.id.txt_type, "消费");
            }else if (lsmxBean.getType().equals("3")){
                holder.setText(R.id.txt_type, "退款");
            }else if (lsmxBean.getType().equals("4")){
                holder.setText(R.id.txt_type, "提现");
            }else if (lsmxBean.getType().equals("5")){
                holder.setText(R.id.txt_type, "推荐用户消费分红");
            }else if (lsmxBean.getType().equals("6")){
                holder.setText(R.id.txt_type, "推荐门店流水分红");
            }
        }

    }
}
